Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@smithy/eventstream-serde-browser
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@smithy/eventstream-serde-browser/latest.svg)](https://www.npmjs.com/package/@smithy/eventstream-serde-browser) [![NPM downloads](https://img.shields.io/npm/dm/@smithy/eventstream-serde-browser.svg)](https://ww
@smithy/eventstream-serde-browser is a package designed to handle serialization and deserialization of event streams in a browser environment. It is part of the AWS SDK for JavaScript and is used to process event streams, which are sequences of events that can be sent and received over a network connection.
Serialization of Event Streams
This feature allows you to serialize an event stream into a format that can be transmitted over a network. The code sample demonstrates how to create an instance of EventStreamMarshaller and serialize an event.
const { EventStreamMarshaller } = require('@smithy/eventstream-serde-browser');
const marshaller = new EventStreamMarshaller();
const event = { eventType: 'example', data: 'sample data' };
const serializedEvent = marshaller.serialize(event);
console.log(serializedEvent);
Deserialization of Event Streams
This feature allows you to deserialize a received event stream back into its original event format. The code sample shows how to create an instance of EventStreamMarshaller and deserialize a binary event stream.
const { EventStreamMarshaller } = require('@smithy/eventstream-serde-browser');
const marshaller = new EventStreamMarshaller();
const serializedEvent = new Uint8Array([/* some binary data */]);
const event = marshaller.deserialize(serializedEvent);
console.log(event);
The 'eventsource' package is a polyfill for the EventSource interface, which allows web applications to receive server-sent events. Unlike @smithy/eventstream-serde-browser, which focuses on serialization and deserialization of event streams, 'eventsource' is more about establishing a connection to receive events from a server.
The 'websocket-stream' package provides a stream interface for WebSockets. It allows you to send and receive data over WebSocket connections using Node.js streams. While @smithy/eventstream-serde-browser is focused on event stream serialization and deserialization, 'websocket-stream' is more about managing WebSocket connections and data transfer.
The 'rxjs' package is a library for reactive programming using Observables, to make it easier to compose asynchronous or callback-based code. It can be used to handle event streams in a reactive manner. Unlike @smithy/eventstream-serde-browser, which is specifically for serialization and deserialization, 'rxjs' provides a broader set of tools for working with asynchronous data streams.
FAQs
[![NPM version](https://img.shields.io/npm/v/@smithy/eventstream-serde-browser/latest.svg)](https://www.npmjs.com/package/@smithy/eventstream-serde-browser) [![NPM downloads](https://img.shields.io/npm/dm/@smithy/eventstream-serde-browser.svg)](https://ww
The npm package @smithy/eventstream-serde-browser receives a total of 5,714,055 weekly downloads. As such, @smithy/eventstream-serde-browser popularity was classified as popular.
We found that @smithy/eventstream-serde-browser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.